<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/header.css" />
	</head>

	<body>

		<header class="mui-bar mui-bar-nav title">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: white;"></a>
			<h1 class="mui-title title-color">个人头像</h1>
			<a id="openMenu" class="mui-icon mui-icon-right-nav mui-pull-right" style="color: white;">...</a>
		</header>

		<div class="mui-content">
			<img id="img_myface" src="image/face-default-cat.png">
		</div>
		
		<div id="sheet-myface" class="mui-popover mui-popover-bottom mui-popover-action ">
		    <!-- 可选择菜单 -->
		    <ul class="mui-table-view">
		      <li class="mui-table-view-cell">
		        <a id="a_choosePhoto" href="#">选择照片</a>
		      </li>
		      <li class="mui-table-view-cell">
		        <a id="a_downloadPhoto" href="#">下载照片</a>
		      </li>
		    </ul>
		    <!-- 取消菜单 -->
		    <ul class="mui-table-view">
		      <li class="mui-table-view-cell">
		        <a href="#sheet-myface"><b>取消</b></a>
		      </li>
		    </ul>
		</div>
		
		
		<script src="js/mui.min.js"></script>
		<script type="text/javascript" src="js/app.js" ></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function() {
				let user = app.getGlobalUserInfo();
				let img_myface = document.getElementById("img_myface");
			
				if(user != null) {
					let faceImage = user.faceImage;
					if(app.isNotNull(faceImage)) {
						img_my_face.src = app.imgServerUrl + faceImage;
					}
				}
				let openMenu = document.getElementById("openMenu");
				openMenu.addEventListener("tap",function(){
					mui("#sheet-myface").popover("toggle");
				});
				let a_choosePhoto = document.getElementById("a_choosePhoto");
				a_choosePhoto.addEventListener("tap",function(){
					mui.openWindow("plugin/v3.1.6/myface-uploader.html","myface-uploader");
					mui("#sheet-myface").popover("toggle");
				});
				let a_downloadPhoto = document.getElementById("a_downloadPhoto");
				a_downloadPhoto.addEventListener("tap",function(){
					
				});
			});
		</script>
	</body>

</html>